Source Code Viewer - Example 10 - OptionalYearSelectBoxDisplay

package name.matthewgreet.example10.view;

import java.util.ArrayList;
import java.util.List;

import name.matthewgreet.strutscommons.view.IntegerListSelectBoxDisplay2;
import name.matthewgreet.strutscommons.view.SelectBoxItemDisplay2;

public class OptionalYearSelectBoxDisplay extends IntegerListSelectBoxDisplay2 {
    protected List<SelectBoxItemDisplay2<Integer,Integer>> getInitialList() {
    	List<SelectBoxItemDisplay2<Integer,Integer>> result;
    	
    	result = new ArrayList<>();
    	result.add(new SelectBoxItemDisplay2<Integer,Integer>("", "", null, null));
    	for (int year = 2025; year > 1899; year--) {
        	result.add(new SelectBoxItemDisplay2<Integer,Integer>(Integer.toString(year), Integer.toString(year), year, year));
    	}
        return result;
    }
    

}